import request from "@/utils/request";
import fetchRequest from "@/utils/fetch";

// deepseek官方接口请求
// export function chatCompletionsAPi(stream: AbortSignal ,messages: Chat.ConversationMessage[]) {
//   return fetchRequest("/chat/completions", {
//     method: "POST",
//     body: JSON.stringify({
//       model: "deepseek-chat",
//       messages: messages,
//       stream: true,
//       stream_options: {
//         include_usage: true,
//       },
//     }),
//     signal: stream
//   });
// }

// // 后端接口请求deepseek
// export const chatCompletionsApi = (stream = '', params = '') => {
// 	return fetchRequest("/system/deepSeekRecords/chat", {
// 		method: "POST",
// 		body: JSON.stringify(params),
// 		signal: stream
// 	});
// }

// 后端接口请求deepseek
// export const chatCompletionsApi = (params = '') => {
// 	return fetchRequest("/system/deepSeekRecords/chat", {
// 		method: "POST",
// 		body: JSON.stringify(params)
// 	});
// }
export const chatCompletionsApi = (params = '') => {
	return request({
		url: "/system/deepSeekRecords/chat",
		method: "POST",
		params,
	});
}

// 获取对话列表
export const chatListApi = (params = '') => {
	return request({
		url: "/system/deepSeekRecords/list",
		method: "get",
		params,
	});
}

// 单个历史记录删除
export const delSinglechatListApi = (params = '') => {
	return request({
		url: "/system/deepSeekRecords/remove",
		method: "get",
		params,
	});
}


// 删除全部历史记录
export const delAllchatListApi = (params = '') => {
	return request({
		url: "/system/deepSeekRecords/removeByUser",
		method: "get",
		params,
	});
}